import com.redislabs.modules.rejson.JReJSON;
import com.redislabs.modules.rejson.Path;


public class RedisJsonDemo1 {

    public static void main(String[] args) {
        RedisJsonDemo1 demo1 = new RedisJsonDemo1();
        //pom 去掉
        // <dependency>
        //            <groupId>redis.clients</groupId>
        //            <artifactId>jedis</artifactId>
        //            <version>4.0.0</version>
        //        </dependency>
        //原生写法
        JReJSON client = new JReJSON("192.168.133.217", 6380);
        demo1.testStr(client);
        demo1.testNum(client);
        demo1.testObject(client);
    }


    public void testStr(JReJSON client){
        client.set("foo","你好");

        String val = client.get("foo", new Path("NOESCAPE"));
        System.out.println(val);
    }

    public void testNum(JReJSON client){
        client.set("num",1);
        Double num = client.get("num");
        System.out.println(num);
    }

    public void testObject(JReJSON client){
         client.get("user");
    }

    public void testArray(JReJSON client){

    }

}
